<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script src="../js/pixi.min.js"></script>
		<script type="text/javascript">
			var app=new PIXI.Application(500,300);
			document.body.appendChild(app.view);
			
			 
			function add(src,x,y,shi){
				var yuans=new PIXI.Sprite.fromImage(src);
				yuans.x=x;
				yuans.y=y;
				app.stage.addChild(yuans);
				yuans.buttonMode=true;
				yuans.interactive=true;
				// yuans.anchor.set(0.5,0.5);
				return yuans;
			}
			var gj= add("img/img/fishBg.png",0,0);
			var jk= add("img/img/fish.png",250,100);
			var zuobx= new PIXI.Text("X:");
			app.stage.addChild(zuobx);
			var zuoby= new PIXI.Text("Y:");
			zuoby.y=20;
			app.stage.addChild(zuoby);
			var zd= add("img/sun.png",jk.x,jk.y);
			app.ticker.add(zdf);
			function zdf()
			{
				zd.x-=1;
				if(zd.x<0)
				{
					zd.x=jk.x;
					zd.y=jk.y;
				}
			}
			
			
			jk.anchor.set(0.5,0.3);
			jk.on("mousemove",mousemove1);
			
			
			function mousemove1(event){
				var  gj= event.data.getLocalPosition(app.stage);
				jk.x=gj.x;
				jk.y=gj.y;
				zuobx.text="X:"+gj.x;
				zuoby.text="Y:"+gj.y;
				
			}
			
			
		</script>
	</body>
</html>